package string;

public class StringBuilder2 {
    public static void main(String[] args) {
        String str = "一个人在家寂寞,来激情Java";
        StringBuilder a = new StringBuilder(str);

        a.append("在线学习");
        System.out.println(a);

        a.delete(0,3);
        System.out.println(a);

        a.replace(6,8,"性感");
        System.out.println(a);

        a.insert(8,"激情");
        System.out.println(a);
    }
}
